/*
<td><input type="button" value="&gt;&gt;" 
        onclick="moveSelect('avail_users[]', 'groups_users[]')" class='btn' /><br>
        <input type="button" value="&lt;&lt;" 
        onclick="moveSelect('groups_users[]', 'avail_users[]')" class='btn' /></td>
<td>

*/
function moveSelect(fromItem, toItem)
{
    var fItem = $(fromItem);
    var tItem = $(toItem);
    if ( fItem.options.selectedIndex >= 0 ) {
        while ( fItem.options.selectedIndex >= 0) {
            ind   = fItem.selectedIndex;
            text  = fItem.options[ind].text;
            value = fItem.options[ind].value;
            fItem.options[ind] = null;
            var newOption = new Option(text,value);
            toFormLength = tItem.options.length;
            tItem.options[toFormLength] = newOption;
        }
    }
    return false;
}

function selectAll(list)
{
    var f = $(list);
    if(f.options.length >= 0){
        for(var i = 0; i<f.options.length; i++){
            f[i].selected = true;
        }
    }
    return true;
}